﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Acoris.Markdown
{
    internal enum ParseFrameType
    {
        Offset,
        Length,
        ItemProperty,
        ItemValue,
        CollectionName,
        CollectionBody,
        Text
    }

    /// <summary>
    /// 
    /// </summary>
    internal class AmlParseFrame
    {
        private int             m_offset;
        private int             m_length;
        private ParseFrameType  m_type;

        public AmlParseFrame(ParseFrameType type,int offset,int length)
        {
            m_offset = offset;
            m_length = length;
            m_type = type;
        }

        public int Offset {
            get { return m_offset; }
        }

        public int Length {
            get { return m_length; }
        }

        public ParseFrameType Type {
            get { return m_type; }
        }

        /// <summary>
        /// 获取与当前对象等价的字符串形式
        /// </summary>
        /// <returns>返回与当前对象等价的字符串形式</returns>
        public override string ToString()
        {
            return $"type:{Type},offset:{Offset},length:{Length}";
        }
    }
}
